package com.acmen.easyapi.model;

import java.util.List;

/**
 * @author acmen
 * 请求节点
 */
public class ReqParamNode extends ParamNode{

    public static String NODE_HEADER = "Headers";
    public static String NODE_PATH_VAR = "PathVariables";
    public static String NODE_PARAM = "Params";
    public static String NODE_BODY = "Body";
    /**
     * 多个参数名必需要其中一个不为空的一个组
     */
    private String requiredGroup;
    /**
     * 必需录入
     */
    private boolean required;
    /**
     * 参数名大长度，缺省为-1
     */
    private Integer maxLength;
    /**
     * 最大值
     */
    private Long max;
    /**
     * 最小值
     */
    private Long min;

    private String validateExp;
    /**
     * 子节点
     */
    protected List<ReqParamNode> subNodes;

    public List<ReqParamNode> getSubNodes() {
        return subNodes;
    }

    public ReqParamNode setSubNodes(List<ReqParamNode> subNodes) {
        this.subNodes = subNodes;
        return this;
    }

    public String getRequiredGroup() {
        return requiredGroup;
    }

    public ReqParamNode setRequiredGroup(String requiredGroup) {
        this.requiredGroup = requiredGroup;
        return this;
    }

    public boolean isRequired() {
        return required;
    }

    public ReqParamNode setRequired(boolean required) {
        this.required = required;
        return this;
    }

    public Integer getMaxLength() {
        return maxLength;
    }

    public ReqParamNode setMaxLength(Integer maxLength) {
        this.maxLength = maxLength;
        return this;
    }

    public Long getMax() {
        return max;
    }

    public ReqParamNode setMax(Long max) {
        this.max = max;
        return this;
    }

    public Long getMin() {
        return min;
    }

    public ReqParamNode setMin(Long min) {
        this.min = min;
        return this;
    }

    public String getValidateExp() {
        return validateExp;
    }

    public ReqParamNode setValidateExp(String validateExp) {
        this.validateExp = validateExp;
        return this;
    }
}
